﻿using System.Collections.Generic;
using System.IO;

namespace Keeton.Core
{
    public class HtmlNode
    {
        private string originalHtmlString;

        public HtmlNode(string htmlString)
        {
            this.originalHtmlString = htmlString;
        }

        public IEnumerable<HtmlAttribute> Attributes { get; private set; }

        public HtmlContent Content { get; private set; }

        public IEnumerable<HtmlNode> Children { get; private set; }

        public static HtmlNode Load(Stream stream)
        {
            var streamReader = new StreamReader(stream);

            var htmlString = streamReader.ReadToEnd();

            var htmlNode = HtmlNode.Load(htmlString);

            return htmlNode;
        }

        private static HtmlNode Load(string htmlString)
        {
            var htmlNode = new HtmlNode(htmlString);

            return htmlNode;
        }
    }
}
